package com.bt.springboot.common.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author zkx
 * @Date 2023/5/29 17:16
 */
public class LocalDateTimeUtil {

	private LocalDateTimeUtil() {
	}

	public static LocalDateTime strToLocalDateTime(String dateStr){
		DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
		return LocalDateTime.parse(dateStr, fmt);
	}

	public static String localDateTimeToStr(LocalDateTime dateTime){
		DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
		return dateTime.format(fmt);
	}
}
